#include "my_double.h"

My_double::My_double(const QString &title, const QString &name_l, const QString &name_r, QWidget *parent) : QGroupBox(title, parent)
{
    this->setAlignment(Qt::AlignCenter);
    left = new My_label(name_l, this);
    right = new My_label(name_r, this);
    layout = new QHBoxLayout();
    layout->addWidget(left);
    layout->addWidget(right);
    layout->setContentsMargins(LEFT_M, TOP_M, RIGHT_M, BOTTOM_M);
    layout->setSpacing(SPACE_SON);
    this->setLayout(layout);
}

void My_double::setNum(double n1, double n2)
{
    left->set_num(n1);
    right->set_num(n2);
}

void My_double::setText(const QString &t1, const QString &t2)
{
    left->set_text(t1);
    right->set_text(t2);
}
